{% extends 'OroUIBundle:Default:index.html.twig' %}
{% oro_title_set({titleTemplate : "%code% - %status%" , params: {'%code%': status_code, '%status%' :status_text }, force : true}) %}
{% block head %}
    <meta name="error" content="{{ status_code }}" />
    {{ parent() }}
{% endblock %}
{% block bodyClass %}error-page{% endblock %}

{% block header %}

    {% block breadcrumb %}
    {% endblock %}

    {% if app.user is not null %}
        {{ parent() }}
        {% if status_code == 503 %}
            {% block navbar %}{% endblock %}
        {% endif %}
    {% else %}
        <header class="navbar" id="oroplatform-header">
            <div class="navbar-inner">
                <div class="container">
                    {% placeholder header_logo %}
                </div>
            </div>
        </header>
    {% endif %}
{% endblock %}

{% block before_content %}
{% endblock %}

{% block scripts_before %}
    {% if app.user is not null %}
        {{ parent() }}
    {% endif %}
{% endblock %}

{% block right_panel %}
{% endblock right_panel %}
{% block left_panel %}
{% endblock left_panel %}

{% block content %}
    <div class="popup-frame">
        <div class="popup-holder">
            <div class="pagination-centered popup-box-errors">
                <h1><span>{{ status_code }}</span> {{ status_text }}</h1>
                <div class="popup-content">
                    <p>
                        {% if status_code == 404 %}
                            {{ 'The page you requested could not be found. Please make sure the path you used is correct.'|trans }}
                        {% elseif status_code == 403 %}
                            {{ "You don't have permission to access this page."|trans }}
                        {% else %}
                            {{ 'The System is currently under maintenance and should be available in a few minutes.'|trans }}
                        {% endif %}
                    </p>
                    {% if status_code == 404 or status_code == 403 %}
                        <p><a href="#" onclick="window.history.back(); return false;">{{ 'Click to go back'|trans }}</a></p>
                    {% endif %}
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block head_script %}
    {{ parent() }}
    <script type="text/javascript">require(['oroui/js/init-errors'])</script>
{% endblock %}
